package org.wukongcrm.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
    * 合同表
    */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "contract")
public class Contract implements Serializable {
    /**
     * 合同编号
     */
    @TableId(value = "contract_id", type = IdType.INPUT)
    private Integer contractId;

    /**
     * 合同名称
     */
    @TableField(value = "`name`")
    private String name;

    /**
     * 客户ID
     */
    @TableField(value = "customer_id")
    private Integer customerId;

    /**
     * 商机ID
     */
    @TableField(value = "business_id")
    private Integer businessId;

    /**
     * 状态 0待审核、1通过、2拒绝、3审核中 4撤回 5未提交 6创建 7已删除 8作废
     */
    @TableField(value = "check_status")
    private Integer checkStatus;

    /**
     * 审核记录ID
     */
    @TableField(value = "examine_record_id")
    private Integer examineRecordId;

    /**
     * 下单日期
     */
    @TableField(value = "order_date")
    private Date orderDate;

    /**
     * 创建人ID
     */
    @TableField(value = "create_user_id")
    private Long createUserId;

    /**
     * 负责人ID
     */
    @TableField(value = "owner_user_id")
    private Long ownerUserId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 合同编号
     */
    @TableField(value = "num")
    private String num;

    /**
     * 开始时间
     */
    @TableField(value = "start_time")
    private Date startTime;

    /**
     * 结束时间
     */
    @TableField(value = "end_time")
    private Date endTime;

    /**
     * 合同金额
     */
    @TableField(value = "money")
    private BigDecimal money;

    /**
     * 整单折扣
     */
    @TableField(value = "discount_rate")
    private BigDecimal discountRate;

    /**
     * 产品总金额
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 合同类型
     */
    @TableField(value = "types")
    private String types;

    /**
     * 付款方式
     */
    @TableField(value = "payment_type")
    private String paymentType;

    /**
     * 批次 比如附件批次
     */
    @TableField(value = "batch_id")
    private String batchId;

    /**
     * 只读权限
     */
    @TableField(value = "ro_user_id")
    private String roUserId;

    /**
     * 读写权限
     */
    @TableField(value = "rw_user_id")
    private String rwUserId;

    /**
     * 客户签约人（联系人id）
     */
    @TableField(value = "contacts_id")
    private Integer contactsId;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 公司签约人
     */
    @TableField(value = "company_user_id")
    private String companyUserId;

    /**
     * 最后跟进时间
     */
    @TableField(value = "last_time")
    private Date lastTime;

    /**
     * 收到的钱
     */
    @TableField(value = "received_money")
    private BigDecimal receivedMoney;

    /**
     * 未收到的钱
     */
    @TableField(value = "unreceived_money")
    private BigDecimal unreceivedMoney;

    /**
     * 旧合同号
     */
    @TableField(value = "old_contract_id")
    private Integer oldContractId;

    private static final long serialVersionUID = 1L;
}